@extends('shop::layouts.master')
@section('title')
    预约单详情
@endsection
<style>
</style>
@section('tab')
    <div style="padding: 20px; background-color: #F2F2F2; ">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body">订单状态:
                        <span style="color: red">
                            {{$arr_data['extend']['order_state_name']}}
                        </span>
                    </div>

                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-header">订单主体信息</div>
                    <div class="layui-card-body ">
                        <div class="layui-card-body layui_overflow_y">
                            <p><span>ID：</span><span>{{$arr_data['id']}}</span></p>
                            <p><span>订单编号：</span><span>{{$arr_data['order_sn']}}</span></p>
                            <p><span>订单类型：</span><span>{{$arr_data['extend']['main_type']}}</span></p>
                            <p><span>预约日期：</span><span>{{$arr_data['appointment_date']}}</span></p>
                            <p><span>预约时段类型：</span><span>{{$arr_data['appointment_time_type']}}</span></p>
                            <p><span>预约时间段：</span><span>{{$arr_data['appointment_times']}}</span></p>
                            <p><span>预约数量：</span><span>{{$arr_data['appointment_num']}}</span></p>
                            <p><span>总检车费用：</span><span>{{$arr_data['price']}}</span></p>
{{--                            <p><span>退款总额：</span><span>{{$arr_data['refund_price']}}</span></p>--}}

{{--                            <p><span>订单状态：</span><span>{{$arr_data['extend']['order_state_name']}}</span></p>--}}
                            <p><span>支付状态：</span><span>{{$arr_data['extend']['pay_state_name']}}</span></p>
{{--                            <p><span>预约状态：</span><span>{{$arr_data['extend']['appointment_state_name']}}</span></p>--}}

                            <p><span>退款状态：</span><span>{{$arr_data['extend']['refund_state_name']}}</span></p>
{{--                            <p><span>检测状态：</span><span>{{$arr_data['extend']['complete_state_name']}}</span></p>--}}
{{--                            <p><span>评价状态：</span><span>{{$arr_data['extend']['appraise_state_name']}}</span></p>--}}

                            <p><span>支付方式：</span><span>{{$arr_data['extend']['payment_method']}}</span></p>
                            <p><span>支付时间：</span><span>{{$arr_data['pay_time']}}</span></p>
                            <p><span>退款时间：</span><span>{{$arr_data['refund_time']}}</span></p>
                        </div>

                    </div>

                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-header">买家信息</div>
                    <div class="layui-card-body layui_overflow_y">
{{--                        <p><span>买家真实姓名：</span><span>{{$arr_data['user']['name']}}</span></p>--}}
                        <p><span>买家昵称：</span><span>{{$arr_data['user']['nickname']}}</span></p>
                        <p><span>买家手机：</span><span>{{$arr_data['user']['phone']}}</span></p>
                        @if(!empty($arr_data['user_company']['company_name']))

                        @endif
                        <p><span>买家企业：</span><span>{{$arr_data['user_company']['company_name']}}</span></p>
                    </div>

                </div>

                <div class="layui-card">
                    <div class="layui-card-header">店家信息</div>
                    <div class="layui-card-body layui_overflow_y">
                        <p><span>店铺名称：</span><span>{{$arr_data['shop']['name']}}</span></p>
                        <p><span>店家手机：</span><span>{{$arr_data['shop']['phone']}}</span></p>
                    </div>
                </div>

                @if($arr_data['appraise_state'] == 2)
                    <div class="layui-card">
                        <div class="layui-card-header">评价信息</div>
                        <div class="layui-card-body layui_overflow_y">
                            <p><span>评分：</span><span>{{$arr_data['shop_checkpoint_apprise']['score']}}</span></p>
                            <p><span>评论内容：</span><span>{{$arr_data['shop_checkpoint_apprise']['content']}}</span></p>
                        </div>

                    </div>
                @endif
            </div>

            @if(!empty($arr_data['check_vehicle']))
                @foreach($arr_data['check_vehicle'] as $key=>$value)
                    <div class="layui-col-md12">
                        <div class="layui-card">
                            <div class="layui-card-body" style="background-color: rgb(152, 211, 255)">车辆子单 : {{$value['order_sn']}}</div>
                        </div>
                    </div>

                    {{--车辆子单信息--}}
                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header">子单信息</div>
                            <div class="layui-card-body ">
                                <div class="layui-card-body layui_overflow_y">
                                    <p><span>ID：</span><span>{{$value['id']}}</span></p>
                                    <p><span>编号：</span><span>{{$value['order_sn']}}</span></p>
                                    <p><span>是否代驾：</span><span>{{$value['is_call_helpdriving'] == 1 ? '是': '否'}}</span></p>
                                    <p><span>产品：</span><span>{{$value['service_specs_ids']}}</span></p>
                                    <p><span>检车费用：</span><span>{{$value['price']}}</span></p>
                                    <p><span>状态：</span><span style="color: red;">{{$value['extend']['order_state_name']}}</span></p>
{{--                                    <p><span>申请状态：</span><span style="color: red;">{{$value['extend']['apply_refund_state']}}</span></p>--}}
{{--                                    <p><span>检测状态：</span><span>{{$value['extend']['check_state']}}</span></p>--}}
                                    <p><span>车牌号码：</span><span>{{$value['plate_no']}}</span></p>

                                    <p><span>车辆识别码：</span><span>{{$value['vin']}}</span></p>
                                    <p><span>车辆类型：</span><span>{{$value['vehicle_type']}}</span></p>
                                    <p><span>所有人：</span><span>{{$value['owner']}}</span></p>
                                    <p><span>车主手机号：</span><span>{{$value['owner_phone']}}</span></p>
                                    <p><span>地址：</span><span>{{$value['address']}}</span></p>
                                    <p><span>使用性质：</span><span>{{$value['use_character']}}</span></p>
                                    <p><span>品牌型号：</span><span>{{$value['brand_model']}}</span></p>
                                    <p><span>发动机号码：</span><span>{{$value['engine_no']}}</span></p>

                                    <p><span>注册日期：</span><span>{{$value['register_date']}}</span></p>
                                    <p><span>发证日期：</span><span>{{$value['issue_date']}}</span></p>
                                    <p><span>是否交强制险：</span><span>{{$value['is_pay_compulsory_insurance'] == 1 ? '是': '否'}}</span></p>
                                    <p><span>是否无违章：</span><span>{{$value['is_no_break_rule'] == 1 ? '是': '否'}}</span></p>
                                    <p>
                                        <span>操作：</span>
                                        <span>
                                            @if($value['extend']['shop_waiting_operate']['can_check'] == 1)
                                                <button class="layui-btn-normal layui-btn layui-btn-xs ajax_member_update" data-href="{{route('shop_order_checkpoint_check_ok',['id'=>$value['id']])}}" data-title="检测完成-合格" href="javascript:;" >检测完成-合格</button>
                                                <button class="layui-btn layui-btn-warm layui-btn-xs ajax_member_update" data-href="{{route('shop_order_checkpoint_check_not_ok',['id'=>$value['id']])}}" data-title="检测完成-不合格" href="javascript:;" >检测完成-不合格</button>
                                                <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="xadmin.open('检测失败-故障','{{route("shop_order_checkpoint_fail_single_page",["id"=>$value["id"]])}}',400,200)" >检测失败-故障</button>
                                            @else
                                                <button class="layui-btn layui-btn-disabled" href="javascript:;" >检测完成-合格</button>
                                                <button class="layui-btn layui-btn-disabled" href="javascript:;" >检测完成-不合格</button>
                                                <button class="layui-btn layui-btn-disabled" href="javascript:;" >检测失败-故障</button>
                                            @endif

                                        </span>
                                    </p>
                                </div>

                            </div>

                        </div>
                    </div>

                    {{--退款信息--}}
                    <div class="layui-col-md6">
                        @if(!is_null($value['refund_success']))
                            <div class="layui-card">
                                <div class="layui-card-header" style="color: red">退款信息</div>
                                <div class="layui-card-body layui_overflow_y">
                                    <p><span>退款单号：</span><span>{{$value['refund_success']['refund_sn']}}</span></p>
                                    <p><span>退款金额：</span><span>{{$value['refund_success']['refund_price']}}</span></p>
                                    <p><span>退款时间：</span><span>{{$value['refund_success']['refund_time']}}</span></p>
                                </div>

                            </div>
                        @endif

                    </div>

                    {{--代驾信息--}}
                    <div class="layui-col-md6">
                        @if($value['is_call_helpdriving'] == 1)
                            <div class="layui-card">
                                <div class="layui-card-header">代驾信息</div>
                                <div class="layui-card-body layui_overflow_y">
                                    <p><span>起点（原）：</span><span>{{$value['helpdriving']['start_address']}}</span></p>
                                    <p><span>途经点（原）：</span><span>{{$value['helpdriving']['center_address']}}</span></p>
                                    <p><span>终点（原）：</span><span>{{$value['helpdriving']['end_address']}}</span></p>
                                    <p><span>取车时间：</span><span>{{$value['helpdriving']['take_car_time']}}</span></p>
                                    <p><span>司机：</span><span>{{$value['jinchen_helpdriving']['driverName']}}</span></p>
                                    <p><span>司机手机：</span><span>{{$value['jinchen_helpdriving']['driverPhone']}}</span></p>

                                    <p><span>起点：</span><span>{{$value['jinchen_helpdriving']['reservationAddress']}}</span></p>
                                    <p><span>途经点：</span><span>{{$value['jinchen_helpdriving']['passageAddress']}}</span></p>
                                    <p><span>终点：</span><span>{{$value['jinchen_helpdriving']['destinationAddress']}}</span></p>
                                    <p><span>乘客手机：</span><span>{{$value['jinchen_helpdriving']['memberPhone']}}</span></p>
                                    <p><span>订单费用：</span><span>{{$value['jinchen_helpdriving']['realAmount']}}元</span></p>
                                    <p>
                                        <span>订单状态：</span>
                                        <span>
                                            @switch($value['jinchen_helpdriving']['orderStatus'])
                                                @case(1)新订单@break
                                                @case(2)司机接单@break
                                                @case(3)执行中@break
                                                @case(4)到达终点@break
                                                @case(5)订单已支付@break
                                                @case(6)已销单@break
                                                @case(7)司机开始等待@break
                                                @case(8)乘客修改终点@break
                                                @case(9)乘客确认上车@break
                                                @case(10)途经点@break
                                                @default

                                            @endswitch
                                        </span>
                                    </p>

                                </div>

                            </div>
                        @endif

                            @if($value['refund_state'] == 2)
                                <div class="layui-card">
                                    <div class="layui-card-header">退款信息</div>
                                    <div class="layui-card-body layui_overflow_y">

                                        @if($arr_data['payment_method'] == 'wechat_app_pay' || $arr_data['payment_method'] == 'wechat_mini_pay')
                                            <p><span>商户退款订单号：</span><span>{{$value['wechat_refund']['out_refund_no']}}</span></p>
                                            <p><span>退款金额：</span><span>{{$value['wechat_refund']['refund_fee']/100}}</span></p>
                                            <p><span>退款备注：</span><span>{{$value['refund_remarks']}}</span></p>
                                        @elseif($arr_data['payment_method'] == 'alipay')
                                            支付宝
                                        @else

                                        @endif

                                    </div>
                                </div>
                            @endif



                    </div>
                @endforeach
            @endif

        </div>
    </div>

@endsection

@section('tab_js')

@endsection